home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12666 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  45 lines

  1. Path: mayne.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: IPC Question
  5. Date: 1 Apr 1996 19:19:30 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4jq6c2INN9gm@mayne.ugrad.cs.ubc.ca>
  8. References: <31606E63.2F20@cybernex.net>
  9. NNTP-Posting-Host: mayne.ugrad.cs.ubc.ca
  10.  
  11. In article <31606E63.2F20@cybernex.net>,
  12. Frank Rachel  <frachel@cybernex.net> wrote:
  13. >What is the best way to do the following: I want to have a "control" program send 
  14. >data to another program for processing. Basically, I will have 'x' copies of a 
  15. >program running, and they will just sit there waiting until the control programs 
  16. >sends them information to process. This is going to be done under AIX 3.2. Any 
  17. >suggestions would be greatly appreciated.
  18.  
  19. If this is within one machine, you are going to have to implement a totally
  20. ordered atomic multicast. This means that either all the processes get all
  21. broadcast messages from the central server int he right order, or the whole
  22. thing goes up in a mushroom cloud.
  23.  
  24. To make sure that processes respond to messages as soon as possible, you need a
  25. hand-optimized assembly-language polling loop. I suggest you use linux, because
  26. x86 assembly is far easier and better understood than POWER. (Or was that
  27. AIX/370? In that case, disregard the following).
  28.  
  29. /* poll.S */
  30.  
  31. #include <sys/syscall.h>
  32.  
  33. .text
  34. .globl        _poll
  35.  
  36. _poll:
  37.         movl    $SYS_read,    %eax
  38.         movl    $buffer,    %ebx
  39.         movl    $size,        %ecx
  40.         int    $0x80
  41.         jmp    _poll
  42.         ret
  43. -- 
  44.  
  45.